from django.core.management.base import BaseCommand
from apps.absent.models import AbsentType

class Command(BaseCommand):
    def handle(self, *args, **options):
        absent_type = ["事假","病假","工伤假","婚假","丧假","产假","育儿假","公假","年假","探亲假"]
        absents = []
        for item in absent_type:
            absents.append(AbsentType(name=item))
        ## bulk.creat 批量创建
        AbsentType.objects.bulk_create(absents)
        self.stdout.write(self.style.SUCCESS("考勤类型铺地数据初始化完成"))